package com.ccom.api.feign;

import com.ccom.api.domain.SysLoginLog;
import com.ccom.api.domain.SysOperLog;
import com.ccom.api.feign.factory.BaseLogFallbackFactory;
import com.ccom.core.common.constant.ServiceNameConstants;
import com.ccom.core.common.model.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 日志服务
 */
@FeignClient(
        path = ServiceNameConstants.BASE_SERVICE_URL_PREFIX + "/log",
        contextId = "sysLogApi",
        value = ServiceNameConstants.BASE_SERVICE,
        fallbackFactory = BaseLogFallbackFactory.class
)
public interface SysLogFeign {
    /**
     * 保存系统日志
     *
     * @param sysOperLog 日志实体
     * @return 结果
     */
    @PostMapping("/saveOperLog")
    Result<Boolean> saveOperLog(@RequestBody SysOperLog sysOperLog);

    /**
     * 保存访问记录
     *
     * @param sysLoginLog 访问实体
     * @return 结果
     */
    @PostMapping("/saveLoginLog")
    Result<Boolean> saveLoginLog(@RequestBody SysLoginLog sysLoginLog);
}
